<script lang="ts" setup>
import { ref } from 'vue'
import detailItem from './components/detail-item.vue'

const getWjxqxx = (data: any) => {
  if (Object.keys(data).length === 0) return (wjxqxxList.value = [])

  if (data.wjbh && data.wjbh.length !== 0) {
    wjxqxxList.value = [data]
    loadDetail(data)
  } else {
    wjxqxxList.value = []
  }
}

const wjxqxxList = ref<any>([])

/* 展示详情 */
const currentItem = ref<any>({})
const loadDetail = (item: any) => {
  currentItem.value = { ...item }
}

defineExpose({ getWjxqxx })
</script>
<template>
  <div class="yx-content">
    <!-- 展示详情 -->
    <detail-item v-if="currentItem.wjbh" :current-item="currentItem"></detail-item>
    <el-empty v-else></el-empty>
  </div>
</template>
<style lang="scss" scoped>
.yx-content {
  width: 100%;
  height: 100%;
  padding: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
